package com.android.kotlincoroutinemvvmdemo.adapter

import android.content.Context
import com.android.kotlincoroutinemvvmdemo.R
import com.android.kotlincoroutinemvvmdemo.bean.OneFi
import com.android.kotlincoroutinemvvmdemo.databinding.RvMainItemLayoutBinding
import com.android.kotlincoroutinemvvmdemo.event.ItemViewEvent

class TwoFiAdapter(context: Context) : BaseRVAdapter<RvMainItemLayoutBinding, OneFi>() {

    private val mContext = context

    override fun getLayoutId() = R.layout.rv_main_item_layout

    override fun bindData(
        holder: RVViewHolder<RvMainItemLayoutBinding>,
        dataItem: OneFi,
        position: Int
    ) {
        dataItem.itemPosition = position
        holder.mBinding.itemViewEvent = ItemViewEvent(mContext, this)
        holder.mBinding.oneFi = dataItem
    }

    override fun getItemViewType(position: Int): Int {
        return CommonRecyclerViewPool.ITEM_TYPE
    }

    override fun enableRecyclerViewPool(): Boolean = true
}